#!/bin/sh -e
#
# test for utf8 support
#
# $Id: kakasi-6,v 1.3 2013-12-17 05:36:58 knok Exp $

LOG=`pwd`/test-log
echo '  *** disabled ' $0 >> $LOG
exit 0
echo '  *** starting ' $0 >> $LOG

. ./env.sh

GNUECHO=/bin/echo

# a KANJI character "AI" (it means "love" in English) in utf8
out=`$GNUECHO -e '\346\204\233' | ../src/kakasi -iutf8 -oeuc`
# AI in EUC-JP
cmp=`$GNUECHO -e '\260\246'`

if [ ! "x$out" == "x$cmp" ]
then
      echo "failed." >> $LOG
      echo "output: $out" >> $LOG
      echo "expection: $cmp" >> $LOG
      exit 1
fi

out=`$GNUECHO -e '\260\246' | ../src/kakasi -ieuc -outf8`
cmp=`$GNUECHO -e '\346\204\233'`

if [ ! "x$out" == "x$cmp" ]
then
      echo "failed." >> $LOG
      echo "output: $out" >> $LOG
      echo "expection: $cmp" >> $LOG
      exit 1
fi

exit 0
